package com.wenhao.meituan.interview;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author Wenhao Tong
 * @create 2021-08-08 10:02
 */
public class Main1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int T = scanner.nextInt();
        for (int t = 0;t < T;t++) {
            int n = scanner.nextInt();
            int k = scanner.nextInt();
            int[] array = new int[n];
            for (int i = 0;i < n;i++) {
                array[i] = scanner.nextInt();
            }
            Arrays.sort(array);
            if (k >= array.length) {
                if (array[k - 1] + 1 <= n) {
                    System.out.println("YES");
                    System.out.println(array[k - 1] + 1);
                } else {
                    System.out.println("NO");
                }
                continue;
            }
            if (array[k] > array[k - 1] && array[k - 1] + 1 <= n) {
                System.out.println("YES");
                System.out.println(array[k - 1] + 1);
            } else {
                System.out.println("NO");
            }
        }
    }
}
